//
//  YNUser.h
//  Messenger
//
//  Created by OC on 15/1/15.
//  Copyright (c) 2015年 李健. All rights reserved.
//
//  用户实体类
//

#import <Foundation/Foundation.h>
#import "YNIMFrameworkTypedef.h"

@interface YNUser : NSObject

//userNo用户编号（imId）
@property (nonatomic, strong) NSString *userNo;

//userNo用户编号（平台userId）
@property (nonatomic, strong) NSString *userId;

//userName用户名称
@property (nonatomic, strong) NSString *userName;

//姓名的拼音
@property (nonatomic, strong) NSString *letterName;

//gender性别1-男  2-女 3-保密
@property (nonatomic) int gender;

//dayOfBirth出生日期
@property (nonatomic, strong) NSString *dayOfBirth;

//telephone联系电话
@property (nonatomic, strong) NSString *telephone;

//email 邮箱
@property (nonatomic, strong) NSString *email;

//post 职务
@property (nonatomic, strong) NSString *post;

//headUrl 头像图标
@property (nonatomic, strong) NSString *headUrl;

//sigature 签名
@property (nonatomic, strong) NSString *sigature;

//part 部门
@property (nonatomic, strong) NSString *ownPart;

//移动端用户状态
@property (nonatomic, strong) NSString *phoneStatus;

//pc用户状态
@property (nonatomic, strong) NSString *pcStatus;

/**HX** 用户的状态-非数据库字段 **/
@property (nonatomic, assign) YNUserStateType userState;

//userType用户类型，1老师，2，学生
@property (nonatomic) int userType;

//removeTag删除标志1：表示该组织机构无效，无需显示  0：有效
@property (nonatomic) int removeTag;

/**
 *  主组织岗位
 */
@property(nonatomic,strong)NSString * mainOrg;

//创建用户详细信息表
+ (BOOL)createInDatabase:(FMDatabase *)db;

//插入用户详细信息
- (BOOL)insertInDatabase:(FMDatabase *)db;

//更新用户详细信息
- (BOOL)updateInDatabase:(FMDatabase *)db;

//判断User是否存在
- (BOOL)isUserExistInDatabase:(FMDatabase *)db;

//更新用户状态信息
- (BOOL)updateUserStatusInDatabase:(FMDatabase *)db updatePcStatus:(BOOL)pcStatus updatePhoneStatus:(BOOL)phoneStatus;

//更新用户头像url
- (BOOL)updateUserheadUrlInDatabase:(FMDatabase *)db;

//删除用户在线状态
+ (BOOL)deleteUserOnlineStatusInDatabase:(FMDatabase *)db;

//2016-9-9jc添加，逻辑删除表中所有数据
+ (BOOL)logicDeleteAllUserDataInDatabase:(FMDatabase *)db;


//查询所有学生信息用户
+ (NSArray *)queryAllStudentUserInDatabase:(FMDatabase *)db;

//查询所有老师信息用户
+ (NSArray *)queryAllTeacherStudentUserInDatabase:(FMDatabase *)db;

//根据关键字查询User
+ (NSArray *)queryUserByKeywords:(NSString *)keyWords  canSearchMe:(BOOL)searchMe database:(FMDatabase *)db onlyGetTeacherData:(BOOL)onlyTeacher;

//根据UserNo查询所属部门
- (NSArray *)queryOrgNoByUserNoInDatabase:(FMDatabase *)db;

//删除表中所有数据
+ (BOOL)deleteAllUserDataInDatabase:(FMDatabase *)db;
#pragma mark ---------孙浪---------
///根据用户imId查询用户（用于im相关）
+ (NSArray *)queryUserByUserNo:(NSString *)userNo database:(FMDatabase *)db;
///根据用户userId查询用户（用于非im的业务相关）
+ (NSArray *)queryUserByUserId:(NSString *)userId database:(FMDatabase *)db;
@end
